﻿using System;
using System.Text;
using System.ServiceModel;
using VideoServices.Common.Enum;

namespace VideoServices.PublishService
{
    [ServiceBehavior]
    public class DeliveryStatusService : IDeliveryStatusService
    {
        /// <summary>
        /// Publishes the delivery status.
        /// </summary>
        /// <param name="deliveryId">The delivery id.</param>
        /// <param name="status">The status.</param>
        [OperationBehavior(TransactionAutoComplete = true, TransactionScopeRequired = true)]
        public void PublishDeliveryStatus(Guid deliveryId, DeliveryStatus status)
        {
            var sb = new StringBuilder("Delivery confirmation received!\n");
            sb.Append("Delivery Id: ");
            sb.Append(deliveryId);
            sb.Append(", Status: ");
            sb.Append(status);
            Console.WriteLine(sb.ToString());
        }
    }
}